home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d20 / dorskel2.arc / XBBSMSG.ARC / XMSG.H < prev   
C/C++ Source or Header  |  1991-12-05  |  6KB  |  115 lines

  1. #ifndef MSGERRS
  2.  
  3.     /* return values for functions in this module.  Also check errno */
  4.  
  5.     #define MSG_NOERR       0
  6.     #define MSG_NOACCESS    1
  7.     #define MSG_NOOPEN      2
  8.     #define MSG_NOMEM       3
  9.     #define MSG_NOSEEK      4
  10.     #define MSG_NOLOCK      5
  11.     #define MSG_NOUNLZSS    6
  12.     #define MSG_REDUCED     7
  13.     #define MSG_NOTEXT      8
  14.     #define MSG_BADAREA     9
  15.     #define MSG_BADNUM      10
  16.     #define MSG_NOREAD      11
  17.     #define MSG_PARTREAD    12
  18.  
  19.     #define MSGERRS
  20. #endif
  21.  
  22. /*-------------------------------------------------------------------------*/
  23. /* XBBS Message header                                                     */
  24. /*-------------------------------------------------------------------------*/
  25. struct __xmsg__ {
  26.       char from[36];
  27.       char to[36];
  28.       char subj[64];
  29.       unsigned int o_point;
  30.       unsigned int length;         /* Length of message */
  31.      unsigned long start;          /* Starting postition in text file              */
  32.       char date[20];
  33.       unsigned int times;          /* Number of times read                         */
  34.       unsigned int dest;           /* Destination node                             */
  35.       unsigned int orig;           /* Origination node number                      */
  36.       unsigned int cost;           /* Unit cost charged to send the message        */
  37.       unsigned int orig_net;       /* Origination network number                   */
  38.       unsigned int dest_net;       /* Destination network number                   */
  39.       char indate[4];              /* import date  (YMD(null))                     */
  40.       unsigned int m_attr;         /* Extra attributes                             */
  41.       unsigned int d_zone;         /* Destination zone                             */
  42.       unsigned int o_zone;         /* Origination zone                             */
  43.       unsigned int attr;           /* Attribute (behavior) of the message          */
  44.       unsigned int d_point;
  45. };
  46.  
  47. typedef struct __xmsg__ XMSG;
  48.  
  49. /* These apply to m_attr */
  50.  
  51. #define MSGDELETED 0x0001  /* deleted message,          0000 0000 0000 0001*/
  52. #define MSGANON    0x0002  /* anonymous message         0000 0000 0000 0010*/
  53. #define MSGECHO    0x0004  /* unmoved echo message      0000 0000 0000 0100*/
  54. #define MSGNET     0x0008  /* unmoved net message       0000 0000 0000 1000*/
  55. #define MSGHOLD    0x0010  /* file attached to msg      0000 0000 0001 0000*/
  56. #define MSGHOST    0x0020  /* being forwarded           0000 0000 0010 0000*/
  57. #define MSGSCANNED 0x0040  /* fidonet scanned           0000 0000 0100 0000*/
  58. #define MSGKEEP    0x0080  /* don't delete              0000 0000 1000 0000*/
  59. #define MSGTREATED 0x0100  /* soft cr's & lf's removed  0000 0001 0000 0000*/
  60. #define MSGPACKED  0x0200  /* message LZSS compressed   0000 0010 0000 0000*/
  61. #define MSGGSCAN   0x0400  /* groupmail scanned         0000 0100 0000 0000*/
  62. #define MSGRSCAN   0x0800  /* rfc0822 scanned           0000 1000 0000 0000*/
  63. /*#define    0x1000  /*  0001 0000 0000 0000*/
  64. /*#define    0x2000  /*  0010 0000 0000 0000*/
  65. /*#define    0x4000  /*  0100 0000 0000 0000*/
  66. #define MSGTAGGED  0x8000  /* used by offline readers   1000 0000 0000 0000*/
  67.  
  68.  
  69. /* FIDO Message attributes (attr)                                           */
  70.  
  71. #define MSGPRIVATE 0x0001  /* private message,          0000 0000 0000 0001 */
  72. #define MSGCRASH   0x0002  /* accept for forwarding     0000 0000 0000 0010 */
  73. #define MSGREAD    0x0004  /* read by addressee         0000 0000 0000 0100 */
  74. #define MSGSENT    0x0008  /* sent OK (remote)          0000 0000 0000 1000 */
  75. #define MSGFILE    0x0010  /* file attached to msg      0000 0000 0001 0000 */
  76. #define MSGFWD     0x0020  /* being forwarded           0000 0000 0010 0000 */
  77. #define MSGORPHAN  0x0040  /* unknown dest node         0000 0000 0100 0000 */
  78. #define MSGKILL    0x0080  /* kill after mailing        0000 0000 1000 0000 */
  79. #define MSGLOCAL   0x0100  /* FidoNet vs. local         0000 0001 0000 0000 */
  80. #define MSGXX1     0x0200  /*                           0000 0010 0000 0000 */
  81. #define MSGXX2     0x0400  /* STRIPPED by FidoNet<tm>   0000 0100 0000 0000 */
  82. #define MSGFRQ     0x0800  /* file request              0000 1000 0000 0000 */
  83. #define MSGRRQ     0x1000  /* receipt requested         0001 0000 0000 0000 */
  84. #define MSGCPT     0x2000  /* is a return receipt       0010 0000 0000 0000 */
  85. #define MSGARQ     0x4000  /* audit trail requested     0100 0000 0000 0000 */
  86. #define MSGURQ     0x8000  /* update request            1000 0000 0000 0000 */
  87.  
  88. /* LZSS routines in xbbslzss.c */
  89.  
  90. char * _fastcall unpack_msg (XMSG *msg,char **hold);
  91. char * _fastcall pack_msg (XMSG *msg,char *hold);
  92.  
  93. /* primitive message access functions in getput.c */
  94.  
  95. int _fastcall get_text (char **hold,XMSG *msg,unsigned int areano,
  96.                         unsigned int messno);
  97. int _fastcall append_text (XMSG *msg,char *hold,unsigned int areano,
  98.                            unsigned int messno);
  99. int _fastcall replace_text (XMSG *msg,char *hold,unsigned int areano,
  100.                             unsigned int messno);
  101. int _fastcall get_mess (XMSG *msg,unsigned int areano,unsigned int messno);
  102. int _fastcall put_mess (XMSG *msg,unsigned int areano,unsigned int messno);
  103. int _fastcall post_message (XMSG *msg,char **hold,unsigned int areano,int isfile);
  104.  
  105. /* miscellaneous message area functions in miscmsg.c */
  106.  
  107. unsigned int _fastcall how_many_msgs (unsigned int areano);
  108.  
  109. /* packet creation/writing functions in makepkt.c */
  110.  
  111. int  _fastcall open_pkt (char *filename,AN_ADDR *hisaddr,AN_ADDR *myaddr);
  112. int  _fastcall write_pkt_msg (int fp,XMSG *amsg,char *text,char *area);
  113. void _fastcall close_pkt (void);
  114.  
  115.